package cn.toma.core;

/**
 * 响应码枚举，参考HTTP状态码的语义
 */
public enum ResultCode
{
	//成功
	SUCCESS(200, "成功"),
	//失败
	FAIL(400, "失败"),
	//未认证（签名错误）
	UNAUTHORIZED(401, "未认证（签名错误）"),
	//接口不存在
	NOT_FOUND(404, "接口不存在"),
	//服务器内部错误
	INTERNAL_SERVER_ERROR(500, "服务器内部错误"),

	TOKEN_NULL(402, "TOKEN IS NULL"),

	PASSWORD_FAIL(1001, "账号或密码错误"),
	PASSWORD_NULL(1002, "密码不能为空"),
	PASSWORD_EQUAL(1003, "输入的密码不一致"),
	ASSESSMENT_DATE(1004, "考核日期不能为空"),
	PASSWROD_INIT_ERROR(1005, "修改密码不能与初始密码一致"),
	EXAMINE_XH(1006, "请选择考核类型序号"),
	DISSATISFACTION(1007, "请填写不满意理由"),

	PHONE_CODE_NULL(1008, "验证码已过期"),
	PHONE_CODE_ERROR(1009, "验证码错误"),
	HTH_NULL(1010, "合同号有误"),
	HTH_PHONE_NULL(1010, "该合同号未绑定手机号码"),

	;


	private final int code;
	private final String msg;


	ResultCode(int code, String msg)
	{
		this.code = code;
		this.msg = msg;
	}


	public int code()
	{
		return code;
	}

	public String msg()
	{
		return msg;
	}

	public int getCode()
	{
		return code;
	}

	public String getMsg()
	{
		return msg;
	}}
